//
//  LBViewController.m
//  LBCoreKit
//
//  Created by 李柰财 on 01/03/2017.
//  Copyright (c) 2017 李柰财. All rights reserved.
//

#import "LBViewController.h"
#import "LBTestDataCacheModel.h"
#import <LBCoreKit/LBCoreKit.h>
#import <LBCoreKit/LBDataCache.h>

@interface LBViewController ()

@end

@implementation LBViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
//    //配置环境
//    [LBURLConfig setupWithType:LBURLENV_CONFIG_TYPE_TEST];
//    [LBService post:LBURL_HOME(@"front/notice/getVersionUpdateNotice") params:nil completion:^(LBResponse *response) {
//        NSURL *viewUserURL = [NSURL URLWithString:@"myapp://user/view/joeldev"];
//        [[UIApplication sharedApplication] openURL:viewUserURL];
//        
//        NSURL *viewUserURL1 = [NSURL URLWithString:@"myapp://user/view1/joeldev"];
//        [[UIApplication sharedApplication] openURL:viewUserURL1];
//    }];
//    LBStringNotNil(nil);
//    
//    LBURL_BEE(@"dds");
//    LBURL_UNIONNUMBER(@"ddd");
    
    LBTestDataCacheModel *model = [[LBTestDataCacheModel alloc] init];
    model.str = @"str111222";
    model.num = @12;
    model.dic = @{@"key1":@"vaule1",@"key2":@"vaule2"};
    model.array = @[@"1",@"2",@"3"];
    LBBuildingSubModel *subModel = [[LBBuildingSubModel alloc] init];
    LBBuildingSubSubModel *subsubModel = [[LBBuildingSubSubModel alloc] init];
    subsubModel.str = @"qeqweqwe";
    subModel.subsubArr = [NSMutableArray arrayWithObjects:subsubModel, nil];
    model.subArr = [NSMutableArray arrayWithObjects:subModel, nil];
    model.subModel = subModel;
    
    [LBDataCache saveDataToDB:model key:@"123456"];
    
//    [LBDataCache deleteDataWithKey:@"123456"];
//
//    [LBDataCache deleteAllData];
    
    LBTestDataCacheModel * model1 = [LBDataCache getDataByClass:[LBTestDataCacheModel class] key:@"123456"];

    NSLog(@"model1=%@",model1);
    
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
